﻿using GameStructure.Contracts;
using GameStructure.Core;
using GameStructure.Types;
using Tao.OpenGl;

namespace GameStructure.GaneState
{
    public class TestSpriteClassState : IGameObject
    {
        readonly Renderer _renderer = new Renderer();
        readonly Sprite _testSprite = new Sprite();
        readonly Sprite _testSprite2 = new Sprite();

        public TestSpriteClassState(TextureManager textureManager)
        {
            _testSprite.Texture = textureManager.Get("face_alpha");
            _testSprite.SetHeight(256*0.5f);

            _testSprite2.Texture = textureManager.Get("face_alpha");
            _testSprite2.SetPosition(-256,-256);
            _testSprite2.SetColor(new Color(1,0,0,1));
        }

        public void Update(double elapsedTime)
        {
            
        }

        public void Render()
        {
            Gl.glClearColor(0.0f,0.0f,0.0f,1.0f);
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);
            _renderer.DrawSprite(_testSprite);
            _renderer.DrawSprite(_testSprite2);
            Gl.glFinish();
        }
    }
}
